package com.promonkey.biz.impl;

import com.promonkey.biz.PetBase;

/**
 * Created by promonkey on 2017/2/21.
 */
public class Dog implements PetBase {

    private String name;
    private int age;
    private int health;

    private static Dog lucky;

    public Dog(String name, int age, int health) {
        this.name = name;
        this.age = age;
        this.health = health;
    }

    //Lucky 吃骨头
    public String eat() {
        return getName() + " eat bone!";
    }

    //Lucky 奔跑
    public String exercise() {
        return getName() + " run!";
    }

    //Lucky 看家
    public String doorkeeper() {
        return getName() + " look after the house!";
    }

    public static Dog getDog() {
        if (lucky == null) {
            lucky = new Dog("Lucky", 5, 95);
        }
        return lucky;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public int getHealthValue() {
        return health;
    }

    @Override
    public String toString() {
        return "-------\n" +
                "name:" + this.getName() +
                "\nage:" + this.getAge() +
                "\nhealth:" + this.getHealthValue() +
                "\n-------";
    }

}
